package com.lxp.ssh2.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lxp.ssh2.dao.UserDAO;
import com.lxp.ssh2.po.User;
import com.lxp.ssh2.service.UserService;


@Service
public class UserServiceImpl implements UserService {

	@Autowired
	private UserDAO userDao;
	
	@Transactional
	@Override
	public List<User> find(String name) {
		return userDao.findAll();
	}

	@Override
	public User findByAccount(String account) {
		return userDao.findByAccount(account);
	}

	/* (non-Javadoc)
	 * @see com.lxp.ssh2.service.UserService#addUser(com.lxp.ssh2.po.User)
	 */
	@Override
	public void addUser(User user) {
		this.userDao.add(user);
	}

}
